// 
// registerElements.js
// 海石后台管理
// 
// 2024/12/27.
// 



// 批量注册打印设计组件

import {defineAsyncComponent} from "vue";

const modules = {
    ...import.meta.glob("./Elements/*.vue"),
};

export default function registerElements(app) {
    for (const path in modules) {
        const type = path.split("/").at(-1).split(".")[1];
        const name = path.split("/").at(-1).split(".")[0];
        if (type === "vue") {
            const has = app.component(name);
            if (has) break;
            app.component(name, defineAsyncComponent(() => import(`./Elements/${name}.vue`)));
        }
    }
}